﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CMS
{
    public partial class LogIn : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            LogInTS.Text = " ";
        }

        protected void LogInButton_Click(object sender, EventArgs e)
        {
            var userName = UserNameTxtBox.Text.Trim();
            var userPassword = UserPasswordTxtBox.Text.Trim();

            var sql =string.Format("select * from Users where Username = '{0}' and Password = '{1}'",userName,userPassword);
            var dt = DbHelper.GetData(sql);
            

            
                    if (dt.Rows.Count > 0)
                    {
                        Response.Redirect("Articleer.aspx");
                    }
                    else
                    {
                        LogInTS.Text = "用户名不存在或密码错误";
                    }

                


            
 
        }
    }
}